import axios from 'axios';
import { loginreq, req } from './axiosFun';

// 登录接口 
export const login = (params) => { return loginreq("post", "/api/login", params) };
// 获取用户菜单
export const menu = (params) => { return axios.get("/api/menu?&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
// 退出接口
export const loginout = () => { return axios.delete("/api/login?&token=" + localStorage.getItem('logintoken')).then(res => res.data) };
// 登录接口 
export const getCode = () => { return loginreq("post", "/api/getcode")};

/**
 * 用户管理 
 **/
// 用户管理-获取用户列表
export const UserList = (params) => { return req("post", "/api/user/list", params) };
// 用户管理-保存（添加编辑）
export const UserUpdateCategory = (params) => { return req("post", "/api/user/category", params) };
// 用户管理-重置密码
export const userReset = (params) => { return req("post", "/api/user/reset", params) };
// 用户管理-充值
export const UserRecharge = (params) => { return req("post", "/api/user/recharge/", params) };




/**
 * 首页管理 
 **/
// 获取配置列表
export const firstList = (params) => { return req("post", "/api/system/first", params) };
// 删除配置
export const swiperDelete = (params) => { return req("post", "/api/system/swiper/delete", params) };

/**
 * 会员卡管理
 **/
// 获取会员卡配置列表
export const cardList = (params) => { return req("post", "/api/system/cardlist", params) };
// 删除会员卡配置
export const cardDelete = (params) => { return req("post", "/api/system/card/delete", params) };

export const AlbumList = (params) => { return req("post", "/api/system/album/list", params) };

export const AlbumDelete = (params) => { return req("post", "/api/system/album/delete", params) };

/**
 * 系统用户管理 
 **/
// 获取用户列表
export const sysUserList = (params) => { return req("post", "/api/sysUser/list", params) };
// 添加或修改用户信息
export const sysUserSave = (params) => { return req("post", "/api/sysUser/save", params) };
// 重置密码
export const SysUserReset = (params) => { return req("post", "/api/sysUser/reset", params) };
// 修改状态
export const SysUserStatus = (params) => { return req("post", "/api/sysUser/status", params) };
// 修改用户角色
export const SysUserRole = (params) => { return req("post", "/api/sysUser/role", params) };
// 删除用户
export const SysUserDelete = (params) => { return req("post", "/api/sysUser/delete", params) };
// 用户自己修改密码
export const PersonalUpdatePwd = (params) => { return req("post", "/api/sysUser/personal/updatepwd", params) };
// 用户自己修改资料
export const PersonalSave = (params) => { return req("post", "/api/sysUser/personal/save", params) };

